﻿using DotLiquid.FileSystems;

namespace Jim.Web.Core;

public class DotliquidTemplateFileSystem : IFileSystem
{
    public string ReadTemplateFile(DotLiquid.Context context, string templateName)
    {
        var path = context[templateName] as string;
        if (string.IsNullOrEmpty(path))
            return path;

        var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "Template");
        string fullPath =  Path.Combine(templatePath, templateName);
        return File.ReadAllText(fullPath);
    }
}
